<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@include file="/common/mytags.jsp" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>权限管理系统</title>
    <link rel="stylesheet" type="text/css" href="<%=basePath%>common/frame/layui/css/layui.css" media="all">
    <link rel="stylesheet" type="text/css" href="<%=basePath%>common/css/gobal.css" media="all">
    <link rel="stylesheet" type="text/css" href="<%=basePath%>common/css/animate.css" media="all">
    <link rel="stylesheet" type="text/css" href="<%=basePath%>backstage/css/login.css" media="all">
    <style type="text/css">
        .avatar img{ border-radius:50%;margin-left: -45px;height: 180px;width: 180px;margin-top: 20px; border: 5px  solid #FFFFFF;}
    </style>
</head>
<body>
<noscript>
    <iframe scr="*.htm"></iframe>
</noscript>
<div class="larry-main layui-layout animated shake larry-delay2" id="larry_login" style=" height: 550px; width: 400px;">
    <div class="title">权限管理中心</div>
    <p class="info">后台登录</p>
    <div class="user-info" style="height: 500px">
        <div class="avatar"><img  id="adminpic" src="<%=basePath%>backstage/images/photo/admin.png" alt=""></div>
        <form class="layui-form" id="larry_form" style="margin-top: 150px;"  method="post">
            <div class="layui-form-item">
                <label class="layui-form-label">手机号</label>
                <input  type="text" id="loginPhone" name="loginPhone" required lay-verify="required" aautocomplete="off"
                        class="layui-input larry-input"  placeholder="请输入您的手机号">
            </div>
            <div class="layui-form-item" id="password">
                <label class="layui-form-label">密&nbsp;&nbsp;&nbsp;码</label>
                <input type="password" name="loginPwd" required lay-verify="required|password"
                       aautocomplete="off"
                       class="layui-input larry-input" placeholder="请输入您的登录密码">
            </div>


            <div class="layui-form-item" style="margin-top: 30px;">
                <button class="layui-btn larry-btn" type="button" id="login" lay-filter="login" lay-submit>立即登录</button>
            </div>
        </form>
    </div>
</div>
<!-- 加载js文件-->

<script type="text/javascript" src="<%=basePath%>common/frame/layui/layui.js"></script>
<script type="text/javascript">
    if (window != top) {
        //top.location.href = location.href;
        top.location.href = "<%=basePath%>/user/login.action";
    }
    layui.config({
        base: "<%=basePath%>/common/larrylib/",
        version: '201708031'
    }).use(["jquery", "common", "layer", "form", "larryMenu"], function () {

        var $ = layui.jquery;
        var r = layui.$, t = layui.layer, form = layui.form, e = layui.common;
        var i = layui.device();
        var n = (r(document).height() - r("#larry_login").height()) / 2.5;




        r("#larry_login").css({"margin-top": n});
        var o = "";
        r("#larry_form input[type='text'],#larry_form input[type='password']").on("focus", function () {
            o = r(this).attr("placeholder");
            r(this).attr("placeholder", "")
        });
        r("#larry_form input[type='text'],#larry_form input[type='password']").on("blur", function () {
            r(this).attr("placeholder", o)
        });
        e.larryCmsLoadJq("<%=basePath%>common/js/jquery.supersized.min.js", function () {
            r.supersized({
                slide_interval: 3e3,
                transition: 1,
                transition_speed: 1e3,
                performance: 1,
                min_width: 0,
                min_height: 0,
                vertical_center: 1,
                horizontal_center: 1,
                fit_always: 0,
                fit_portrait: 1,
                fit_landscape: 0,
                slide_links: "blank",
                slides: [{image: "<%=basePath%>backstage/images/login/1.jpg"}, {image: "<%=basePath%>backstage/images/login/2.jpg"}, {image: "<%=basePath%>backstage/images/login/3.jpg"}]
            })
        });
        enter("login");

        form.on("submit(login)", function (data) {
            var loginLoading = top.layer.msg('登陆中，请稍候', {icon: 16, time: false, shade: 0.8});
            $.ajax({
                url: '<%=basePath%>user/login',
                type: 'post',
                async: false,
                data: data.field,
                dataType: "json",
                success: function (data) {
                    top.layer.close(loginLoading);
                    console.log(data);
                    if(data.state==200){
                            window.location.href="<%=basePath%>user/welcome";
                    }else{
                        top.layer.msg(data.message, {icon: 5});
                        return false;
                    }
                }
            });


        });
    })
    ;
</script>
<div style="display: none;">
    <script>
        var _hmt = _hmt || [];
        (function () {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?683b4c583c6d476ef94189e9316d1ad4";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
</div>
</body>
</html>
